.switch {
    position: relative;
    display: flex;
    --height-switch: 20px;
    height: var(--height-switch);
    width: calc(var(--height-switch) * 2);
}

.switch input {
    opacity: 0;
    height: 0;
    width: 0;
}

.slider {
    display: block;
    position: relative;
    cursor: pointer;
    height: var(--height-switch);
    width: calc(var(--height-switch) * 2);
    transition: 0.2s;
    background-color: var(--color-main);
    box-shadow: inset 0 0 0 1px var(--color-main);
    border-radius: var(--height-switch);
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    top: 50%;
    left: 2px;
    bottom: 2px;
    background-color: var(--color-bg-body);
    transform: translateY(-50%);
    border-radius: 50%;
    transition: 0.2s;
}

.switch input:checked + .slider {
    background-color: var(--color-bg-body);
}

.switch input:checked + .slider:before {
    transform: translateY(-50%) translateX(var(--height-switch));
    background-color: var(--color-main);
}
